<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 组件的标签上面加的事件，一律都是自定义事件 -->
      <!-- native修饰符可以将自定义事件，尝试转成原生事件 -->
      <child @click.native="fn"></child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      const Child = {
        template: `
          <div>child组件</div>
        `,
        // mounted() {
        //   this.$emit("click");
        // },
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
        },
        methods: {
          fn() {
            console.log("fn");
          },
        },
      });
    </script>
  </body>
</html>
